<?php
		

		direct_url();
		$id=$_GET['id']; //string nha
		
		$db=new Model2;
		$id=mysql_real_escape_string($id);
		//-------------------------- GET TRUYEN ----------------
		$db->query("select * from truyen_tacgia where alias='".$id."'");
		if($db->num_rows()>0){
				$r1=$db->fetchOne();
				$db->close();
				$data['theloai']=$r1;

				$cache=new Cache;
				
		
		
		
		$url=truyenf1_url_truyen_tacgia($r1['alias']).'/';
		$og_url=truyenf1_url_truyen_tacgia($r1['alias']);

		$sql ="select * from truyen_tacgia_fk where tacgia_id=".$r1['id']." order by truyen_id desc";
		$sql2="select truyen_id from truyen_tacgia_fk where tacgia_id=".$r1['id'];
		
		
		//echo $sql2;
		
		$pager = new Pagination2($sql,24,4,$url,1800,'truyen_2');
		$pager->ajax=1;
		$pager->setDebug(false);
		$data['info'] = $pager->paginate($cache,$sql2);
		$data['nav']	= $pager->renderFullNav();
		}
	
	
			$data1['og']='<link rel="canonical" href="'.$og_url.'" /><meta name="ROBOTS" content="INDEX, FOLLOW"/>';
			$data1[title]=web_title($r1['seo_title'].$title);
			$data1['mota']=$r1['seo_description'].$title;
			$data1['keyword']=$r1['seo_keyword'].",".$title;
			
			loadview('template/header_truyen',$data1);
			loadview("truyen/list_tacgia",$data);
			loadview('template/footer_truyen');
			exit();
			
			
